package com.zhangwj;

import java.util.Date;

public class Conflict {

	public static void main(String[] args) {
		System.out.println("this file to learn resolve conflict");
		getDate();
	}

    public static void getDate(){
	    for(int i=0;i<10;i++) {
	    	System.out.println(i);
	    }
        System.out.println(new Date());
        //20191014
        sort(new int[] {1,9,4,2,3});
        
    }
    
    /**
     * 冒泡排序
     * @param numbers
     */
    public static void sort(int[] numbers){
    	int length=numbers.length;
    	for(int i=0;i<=length-2;i++) {
    		for(int j=i+1;j<=length-1;j++) {
    			if(numbers[i]>numbers[j]) {
    				int temp=numbers[i];
    				numbers[i]=numbers[j];
    				numbers[j]=temp;
    			}
    		}
    	}
    	
		/*
		 * for(int i=0;i<length-1;i++) { for(int j=0;j<length-i-1;j++) {
		 * if(numbers[j]>numbers[j+1]) { int temp=numbers[j]; numbers[j]=numbers[j+1];
		 * numbers[j+1]=temp; } } }
		 */
    	
    	for(int i=0;i<length;i++) {
    		System.out.println(numbers[i]);
    	}
    }
    

}
